//
//  mesh.h
//  RenderV1
//
//  Created by 黄翔 on 2019/9/9.
//  Copyright © 2019 黄翔. All rights reserved.
//

#ifndef mesh_h
#define mesh_h

#include <vector>

#include "Shader.h"
#include "Camera.h"
#include "Texture.h"
#include "HMath.h"
#include "CombineInstance.h"
#include "ReferenceCounted.h"

namespace hxe 
{
    class Mesh : public ReferenceCounted
    {
    public:
        std::vector<Vector3>* vertices;
        std::vector<Vector3>* normals;
        std::vector<Vector2>* uv;
        std::vector<unsigned int>* indices;

        unsigned int vbo;
        unsigned int vao;
        unsigned int ebo;

    public:
        Mesh(std::vector<Vector3>* vertices, std::vector<unsigned int>* indices);
        Mesh(std::vector<Vector3>* vertices, std::vector<Vector3>* normals, std::vector<Vector2>* uv, std::vector<unsigned int>* indices);
        Mesh(std::vector<CombineInstance>& combines);

        ~Mesh();

        void setupMesh();
    };
}

#endif /* mesh_h */
